﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AceSoft.RetailPlus.Models
{
    public class PageNavigationModel
    {
        //As per controllers
        enum NavItems
        {
            Loans,
            Reports,
            AdministrationFiles
        }

        public static string Loans { get; private set; }
        public static string Reports { get; private set; }
        public static string AdministrationFiles { get; private set; }

        private static void resetValues()
        {
            Loans = "";
            Reports = "";
            AdministrationFiles = "";
        }

        public static void DetectCurrentPage()
        {       
           string currController=  HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
           string activeFlag = "current";

           resetValues();

           if (currController == NavItems.Loans.ToString()) Loans = activeFlag;

           if (currController == NavItems.Reports.ToString()) Reports = activeFlag;

           if (currController == NavItems.AdministrationFiles.ToString()) AdministrationFiles = activeFlag;
        }



    }
}